<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  User: Ivan wei
  --%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>课程查询系统</title>
    <style>
        input{
            border: none;
            outline: none;
            background-color: transparent;
            width: 100%;
            height: 100%;
            text-align: center;
        }
        .b1:hover{
            background-color: aqua;
        }
        select{
            border: none;
            outline: none;
            background-color: transparent;
        }
        .one:hover {

            background-color: yellow;
        }
    </style>
</head>
<body style="min-width: 760px">
<h1 style="text-align: center">班级系统</h1>
<hr>
<%@include file="/common.jsp"%>
<div style="display: flex;flex-direction: column;align-items: center">
    <h2>教师任课班级课程管理</h2>

    <table  style="min-width: 760px;background-color: rgb(235,242,241);" border="1">
        <tr>
            <th>教师ID</th>
            <th>教师名称</th>
            <th>班级编号</th>
            <th>班级名称</th>
            <th>课程号</th>
            <th>课程名称</th>
            <th>操作栏</th>
        </tr>
        <c:forEach var="ClassTimetable" items="${task}">
            <form method="post" action="/Administrator/task/delete.do">
                <tr>
                    <td ><input class="one" type="text" name="id" value="<c:out value="${ClassTimetable.tid}"></c:out>" readonly></td>
                    <td> <input class="one" type="text" name="tname" value="<c:out value="${ClassTimetable.tName}"></c:out>" readonly></td>
                    <td ><input class="one" type="text" name="user" value="<c:out value="${ClassTimetable.cid}"></c:out>" readonly></td>
                    <td> <input class="one" type="text" name="pwd" value="<c:out value="${ClassTimetable.cname}"></c:out>" readonly></td>
                    <td ><input class="one" type="text" name="c_id" value="<c:out value="${ClassTimetable.c_id}"></c:out>" readonly></td>
                    <td> <input class="one" type="text" name="c_name" value="<c:out value="${ClassTimetable.c_name}"></c:out>" readonly></td>
                    <td> <input type="submit" class="b1" value="删除" ></td>
                </tr>
            </form>
        </c:forEach>
    </table>
    <hr>
    <h4>添加新的教学安排 教师-班级-课程</h4>
    <table style="min-width: 760px;background-color: rgb(235,242,241);" border="1">
        <tr>
            <th>教师</th>
            <th>班级</th>
            <th>课程</th>
            <th>操作栏</th>
        </tr>
        <form method="post" action="/Administrator/task/add.do">
            <tr style="text-align: center;">
                <td >
                    <select name="teacher">
                        <c:forEach var="Teacher" items="${tea}">

                            <option value="${Teacher.id}" >${Teacher.name}</option>

                        </c:forEach>

                    </select>
                </td>
                <td>
                    <select name="clazz">
                        <c:forEach var="Clazz" items="${cla}">

                            <option value="${Clazz.id}" >${Clazz.name}</option>

                        </c:forEach>
                    </select>
                </td>
                <td >
                    <select name="courses">
                        <c:forEach var="Course" items="${cou}">

                            <option value="${Course.id}" >${Course.name}</option>

                        </c:forEach>
                    </select>
                </td>
                <td> <input type="submit" class="b1" value="添加任课" ></td>
            </tr>
        </form>
    </table>

</div>
<div style="text-align: center">
    <br>
    <hr>
    <p style="text-align: center">教师任课班级课程管理， 只做删除及插入， 插入时要判断 教师ID,班级编号,课程编号在 t_task 是否已经存在</p>
</div>
<h2 style="color: red;text-align: center">${err}</h2>
</body>
</html>
